#include "date.h"
namespace Chrono{
    
Date Date::default_date(1, Oct, 1949);

const int Date::_days[12] = {31, 28, 31, 30, 31,30,31,31, 30, 31,30,31};
Date::Date(int dd, Month mm, int yy):_day(dd),_month(mm),_year(yy)
{    dd == 0 ? default_date.
}

void Date::add_year()
{
    _year += 1;
    if ( _day > n_days(_month,_year)){
        _day = n_days(_month, _year);
    }
}
void Date::add_month()
{
    _month = _month % 12 + 1;
    if( _month == 1){
        add_year();
    }
    if ( _day > n_days(_month,_year)){
        _day = n_days(_month, _year);
    }
}    
void Date:: add_day()
{
    _day = (_day)%n_days(_month,_year) + 1;
    if(_day == 1){
        add_month();
    }
}
const int _days[12] = {31, 28, 31, 30, 31,30,31,31, 30, 31,30,31};

ostream& operator << (ostream& os, const Date& date)
{
    os << setfill('0');
    return os << setw(4) << date.year() << "/"
              << setw(2) << date.month() << "/"
              << setw(2) << date.day() << endl;

}
istream& operator >> (istream& is, Date& date)
{
    return is >> date._year >> date._month >> date._day;
}
bool is_leapyear(int y)
{
    return !(y%4) and ((y%100) or !(y%400));
}
int Date::day()const
{
    return _day;
}
int Date::month()const
{
    return _month;
}
int Date::year()const
{
    return _year;
}
}

